package lightrain.web;

import java.util.Map;

import lightrain.code.util.NData;
import lightrain.code.util.NObject;
import lightrain.code.util.function.NRender;


public  class NController{

	
	
	/**
	 * 返回Map 对象
	 * @auther Y.hj
	 * @param render
	 * @return
	 */
	public Map<String, Object> render(NRender render){
		NData data = new NData();
		render.render(data);
		Map<String, Object> dataMap = new NObject<NData>();
		if(data.code != null){
			dataMap.put("code", data.code);
		}
		if(data.success != null){
			dataMap.put("success", data.success);
		}
		if(data.msg != null){
			dataMap.put("msg", data.msg);
		}
		if(data.data != null){
			dataMap.put("data", data.data);
		}
		dataMap.putAll(data);
		data.clear();
		data = null;
		return dataMap;
	}


	
	
	
}
